package com.hz.filemanager.ui.file.adapter;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.hz.filemanager.ui.file.DocsActivity;

import java.util.List;

public class DocsPageAdapter extends FragmentPagerAdapter {

    private Context context;
    private List<? extends Fragment> viewPages;

    public DocsPageAdapter(@NonNull FragmentManager fm, List<? extends Fragment> pages) {
        super(fm);
        this.viewPages = pages;
    }


    @Override
    public int getCount() {
        return DocsActivity.DOCS_TYPE.length;
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return DocsActivity.DOCS_TYPE[position];
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return viewPages.get(position);
    }
}
